<template>
  <div>
    <!-- <h3>当前最新的count值是:{{count}}</h3> -->
    <h3>{{num}}</h3>
    <button>-1</button>
    <button @click="sub">-step</button>
    <button @click="sub2">-step Async</button>
  </div>
</template>

<script>
import { mapState,mapMutations, mapActions,mapGetters } from 'vuex'
export default {
    name:'Subtraction',
    data(){
        return{}
    },
    computed:{
        ...mapState(['count']),
        ...mapGetters(['num'])
    },
    methods:{
        ...mapMutations(['subtraction']),
        ...mapActions(['subtraction1']),
        sub(){
            this.subtraction(2)
        },
        sub2(){
            this.subtraction1(5)
        }
    }

}
</script>

<style>

</style>